$(function(){
	$("#right").load("/toPath?path=web/right-"+$("#nav_01").index()+".html");
})

function choose(value){
    var index=$(value).index();
    var ul=document.getElementById('menu');
    var ul_lis=ul.getElementsByTagName('li');
	for (var i = 0; i < ul_lis.length; i++) {
		if(i==index){
			ul_lis[i].setAttribute("id","nav_01")
			$("#index_right").load("/toPath?path=web/right-"+i+".html");
		}else{
			ul_lis[i].removeAttribute ("id")
		}
	}
}

function logout() {
	$.ajax({
		url: "/shiro/logout?source=1",
		type: "post",
		dataType: "json",
		data:{},
		success: function(data){
			if(data.code==1){
				alert("退出成功");
				location.href="/";
			}else {
			    alert("注销失败");
			}
		},
		error: function(msg){
			alert("ajax连接异常："+msg);
		}
	});
}
